﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LigerMVC.Common.Extensions
{
    public static class IEnumerableExtension
    {
        public static IEnumerable<T> ForEach<T>(this  IEnumerable<T> source, Action<T> action) 
            where T : class,new()
        {
            foreach (var item in source)
            {
                action(item);
                yield return item;
            }
        }
         
    }
}